/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.

	This file is part of Maxsi Installer.

	Maxsi Installer is free software: you can redistribute it and/or modify it
	under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	Maxsi Installer is distributed in the hope that it will be useful, but
	WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
	or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
	License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with Maxsi Installer. If not, see <http://www.gnu.org/licenses/>.

	Maxsi Installer
	An installer that downloads and sets up software, data, and games.

	PageInitializing.cpp
	The page that asks the user what to install and then loads information
	about it.

******************************************************************************/

#include "MaxsiLibrary.h"
#include "UI.h"
#include "PageInitializing.h"
#include "PageInstalling.h"

PageInitializing::PageInitializing()
{
	Install		=	NULL;
}

PageInitializing::~PageInitializing()
{
	
}

MaxsiError PageInitializing::CreateControls()
{
	Install		=	Window->CreateChild(_MESTR("Button"), 100, 24, Window->Width()-1*125, Window->Height()-60, _MESTR("Install"));
	
	return MAXSI_ERROR_SUCCESS;
}

MaxsiError PageInitializing::DeleteControls()
{
	WindowSystem->DeleteWindow(Install);

	return MAXSI_ERROR_SUCCESS;
}

MaxsiError PageInitializing::OnEvent(MaxsiWindowEvent* Event)
{
	if ( Event->Owner == Install && Event->Type == MAXSI_EVENT_PRESSED )
	{
		return SetReplacement(new PageInstalling);
	}

	return MAXSI_ERROR_NOT_SUPPORTED;
}

